#ifndef MENU_H
#define MENU_H

#include <QDialog>
#include <QMutex>
#include <QTimer>
#include "Bed.h"
#include "FromMyDialog.h"
#include "Line.h"
#include "MWidget.h"
#include "Operator.h"
#include "Set.h"
namespace Ui {
class Menu;
}

class Menu : public MyDialog
{
    Q_OBJECT

public:

    explicit Menu(MWidget *parent = nullptr);
    ~Menu();
    void createModule(QString str);

    static QMutex patientsLock;
    static QList<Information> patients;
    FromMyDialog* getOperDialog();
    FromMyDialog* getBedDialog();
    FromMyDialog* getLineDialog();
    FromMyDialog* getsetDialog();
signals:
    void showSiri_signal();
    //void showPatient_signal(QString str);
    void sendServerData_signal(QString str,bool isTimer);
protected:
    bool eventFilter(QObject *watched, QEvent *event);
public slots:
    void receiveServerData_slot(int function,QMap<QString,QString> kv);
    void siriWork(MyDialogName dialogName,functionFlag flag);



private:
    Ui::Menu *ui;
    FromMyDialog* bedDialog=nullptr;
    Bed *bed_=nullptr;

    FromMyDialog *operDialog=nullptr;
    Operator *oper_=nullptr;

    FromMyDialog* lineDialog=nullptr;
    Line *line_=nullptr;

    FromMyDialog* setDialog=nullptr;
    Set *set_=nullptr;

    void analysisPatients(QString information);

};

#endif // MENU_H
